import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";

// https://vite.dev/config/
export default defineConfig({
  plugins: [tailwindcss(), react()],
  build: {
    cssCodeSplit: false,
    lib: {
      entry: 'src/index.js',
      name: 'gamepad2touch',
      formats: ['es', 'umd'],
      fileName: (format) => `[name].${format}.js`
    },
    rollupOptions: {
      external: ['react', 'react-dom'],
    },
    outDir: 'lib',
    emptyOutDir: true
  }
});
